package com.xsd.state.computerDemo;

/**
 * @Description: 电脑控制器
 * @Author: zhoufuzong
 * @Created: 2021-03-11 22:23:28
 * @Version: 1.1.0
 */

public class PCController extends ComputerPowerController {
    private ComputerState state;

    public PCController setState(ComputerState state) {
        this.state = state;
        return this;
    }

    @Override
    public void powerOn(){
        setState(new ComputerPowerOnState());
        System.out.println("====打开电脑");
    }

    @Override
    public void powerOff() {
        setState(new ComputerPowerOffState());
        System.out.println("===关机");

    }

    @Override
    public void powerSleep() {

        setState(new ComputerPowerSleepState());
        System.out.println("=== 休眠");
    }

    public void openApplication(){
        state.openApplication();
    }

    public void closeApplication(){
        state.closeApplication();
    }

    public void modifyTheme(){
        state.modifyTheme();
    }
}
